package com.zhaopin;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

@PropertySource("classpath:appSource.properties")
@Configuration
@SpringBootApplication
@EnableCaching
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);

        /*new SpringApplicationBuilder().sources(Application.class).bannerMode(Banner.Mode.OFF).run(args);*/

        /*SpringApplication application = new SpringApplication(Application.class);
//        application.setBannerMode(Banner.Mode.OFF);
        // 创建Properties
        Properties properties = new Properties();
        // 通过当前类的ClassLoader
        InputStream is= Application.class.getClassLoader()
                .getResourceAsStream("app.properties");
        // 将输入流读取成properties
        try {
            properties.load(is);
        } catch (IOException e) {
            e.printStackTrace();
        }

        application.setDefaultProperties(properties);

        application.run(args);*/


    }

}
